﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
namespace DTO
{
    public class Theme
    {
        int id;
        String name;
        String filePath;
        String image;

        public Theme()
        {
        }

        /// <summary>
        /// Theme ID.
        /// </summary>
        public int ID
        {
            get { return this.id; }
        }
             /// <summary>
        /// Create DTO.Theme instance using SqlDataReader object.
        /// </summary>
        /// <param name="reader">Object contains informations get from DB.</param>
        public Theme(SqlDataReader reader)
        {
            if (reader != null && !reader.IsClosed)
            {
                 id = reader.GetInt32(0);
                 name = reader.GetString(1);
                 filePath = reader.GetString(2);
                 image = reader.GetString(3);
              }
        }
        /// <summary>
        /// Theme name.
        /// </summary>
        public String Name
        {
            get { return this.name; }
            set
            {
                if (value == null || "".Equals(value))
                    throw new Exception("The theme name is null.");
                else
                    this.name = value;
            }
        }

        /// <summary>
        /// Link to CSS file.
        /// </summary>
        public String FilePath
        {
            get { return this.filePath; }
            set { this.filePath = value; }
        }

        /// <summary>
        /// Image about this theme.
        /// </summary>
        public String Image
        {
            get { return this.image; }
            set { this.image = value; }
        }
    }
}